{
  "properties" : { },
  "id" : "copy1718113256058d11668",
  "script" : null,
  "groupId" : "ae51f810d897422c90b6ceb493592794",
  "name" : "test_jedis",
  "createTime" : null,
  "updateTime" : 1718116437689,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/test_jedis",
  "method" : "GET",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 1,\n    \"message\": \"success\",\n    \"data\": \"jedis2\",\n    \"timestamp\": 1718116433993,\n    \"requestTime\": 1718116433983,\n    \"executeTime\": 10\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import redis.clients.jedis.JedisSentinelPool
// return 'Hello magic-api'

// import redis;
// return redis.get('name2')
// return redis.set('name2',"lin2");

import redis.clients.jedis.UnifiedJedis;
import redis.clients.jedis.Protocol;
import redis.clients.jedis.args.SortingOrder;
import redis.clients.jedis.json.Path2;
import redis.clients.jedis.resps.Tuple;
import redis.clients.jedis.search.Document;
import redis.clients.jedis.search.FTCreateParams;
import redis.clients.jedis.search.FTSearchParams;
import redis.clients.jedis.search.FTSpellCheckParams;
import redis.clients.jedis.search.IndexDataType;
import redis.clients.jedis.search.IndexDefinition;
import redis.clients.jedis.search.IndexOptions;
import redis.clients.jedis.search.Query;
import redis.clients.jedis.search.Schema;
import redis.clients.jedis.search.SearchResult;
import redis.clients.jedis.search.aggr.AggregationBuilder;
import redis.clients.jedis.search.aggr.AggregationResult;
import redis.clients.jedis.search.aggr.Reducers;
import redis.clients.jedis.search.schemafields.NumericField;
import redis.clients.jedis.search.schemafields.SchemaField;
import redis.clients.jedis.search.schemafields.TagField;
import redis.clients.jedis.search.schemafields.TextField;
import redis.clients.jedis.search.schemafields.GeoField;
import redis.clients.jedis.BuilderFactory;
import redis.clients.jedis.CommandArguments;
import redis.clients.jedis.CommandObject;
import redis.clients.jedis.RedisProtocol;
import redis.clients.jedis.json.JsonProtocol;
import redis.clients.jedis.json.commands.RedisJsonV2Commands;
import redis.clients.jedis.search.*;
import redis.clients.jedis.search.Schema.*;
import redis.clients.jedis.search.SearchResult;
import redis.clients.jedis.json.JsonSetParams;
import redis.clients.jedis.args.GeoUnit;

//   redis:
//     host: 192.168.1.137
//     port: 6382
//     database: 0
//     timeout: 5000
//     password: fI@#F5&8Fd*356

// UnifiedJedis jedis = new UnifiedJedis("redis://192.168.10.250:6382");

// jedis.sendCommand(Protocol.Command.AUTH, "fI@#F5&8Fd*356");

import env;

var nodes = env.get("spring.redis.sentinel.nodes");

var sentinels = new HashSet();
for(node in nodes.split(",")){
    sentinels.add(node);
}
// sentinels.add("192.168.10.250:26379");
// sentinels.add("192.168.10.250:26380");
// sentinels.add("192.168.10.250:26381");
JedisSentinelPool pool = new JedisSentinelPool("mymaster", sentinels);

// return pool

Jedis jedis = pool.getResource();

jedis.set("jedis", "jedis2");

var ret = jedis.get("jedis");

// pool.returnResource(jedis);

jedis.close();
pool.close();

return ret;

// GenericObjectPoolConfig<Jedis> config = new GenericObjectPoolConfig<>();
// JedisSentinelPool pool = new JedisSentinelPool(MASTER_NAME, sentinels, config, 1000,
//     "foobared", 2);
// Jedis jedis = pool.getResource();
// jedis.auth("foobared");
// jedis.set("foo", "bar");
// assertEquals("bar", jedis.get("foo"));
// jedis.close();
// pool.close();
// assertTrue(pool.isClosed());